package com.kzd.sdk.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.Gson;

public class KZD_SdkPayParams implements Parcelable {

    private String cpOrderId;//订单号,没有传0
    private String roleId;//角色id
    private String money;//支付金额
    private String smallId;//登录成功返回的UID
    private String serverId;//区服ID
    private String extInfo;//扩展参数

    protected KZD_SdkPayParams(Parcel in) {
        cpOrderId = in.readString();
        roleId = in.readString();
        money = in.readString();
        smallId = in.readString();
        serverId = in.readString();
        extInfo = in.readString();
    }

    public KZD_SdkPayParams(
            String smallId,  String cpOrderId, String roleId, String money, String serverId, String extInfo
    ) {
        this.cpOrderId = cpOrderId;
        this.roleId = roleId;
        this.money = money;
        this.smallId = smallId;
        this.serverId = serverId;
        this.extInfo = extInfo;
    }

    public KZD_SdkPayParams(){}

    public static final Creator<KZD_SdkPayParams> CREATOR = new Creator<KZD_SdkPayParams>() {
        @Override
        public KZD_SdkPayParams createFromParcel(Parcel in) {
            return new KZD_SdkPayParams(in);
        }

        @Override
        public KZD_SdkPayParams[] newArray(int size) {
            return new KZD_SdkPayParams[size];
        }
    };

    public String getCpOrderId() {
        return cpOrderId;
    }

    public void setCpOrderId(String cpOrderId) {
        this.cpOrderId = cpOrderId;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String charId) {
        this.roleId = charId;
    }

    public String getMoney() {
        return money;
    }

    public void setMoney(String money) {
        this.money = money;
    }

    public String getSmallId() {
        return smallId;
    }

    public void setSmallId(String userId) {
        this.smallId = userId;
    }

    public String getServerId() {
        return serverId;
    }

    public void setServerId(String serverId) {
        this.serverId = serverId;
    }

    public String getExtInfo() {
        return extInfo;
    }

    public void setExtInfo(String extInfo) {
        this.extInfo = extInfo;
    }

    @Override
    public String toString() {
        return new Gson().toJson(this);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(cpOrderId);
        dest.writeString(roleId);
        dest.writeString(money);
        dest.writeString(smallId);
        dest.writeString(serverId);
        dest.writeString(extInfo);
    }
}
